package com.yenlien.traceyun.business.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 生产原料辅料
 */
@Entity
@Table(name = "t_produce_process_materials")
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
// 该注解在打包养殖时注释掉，打包种植时放开（不一定正确）  如果引入错误步骤则会导致 分包赋码过程出现问题
//@Trace(appName = "plant", stepName = "processMaterials", order = 4, crossPoint = {"trace:reapDetail", "purchase:storageManage"})
public class ProcessMaterials extends TraceEntity {

    @Transient
    private String selectId;
    /**
     * 0原料，1辅料
     */
    @Column(name = "type", length = 1)
    private String type;

    @Column(name = "processPlanId", length = 50)
    private String processPlanId;       // 生产计划ID

    @Column(name = "materialName", length = 20)
    private String materialName;        //原料名称

    @Column(name = "materialCode", length = 50)
    private String materialCode;         //原料代码

    @Column(name = "materialBatch", length = 50)
    private String materialBatch;         //原料批号

    @Column(name = "materialSupplier", length = 20)
    private String materialSupplier;       //原料供应商

    @Column(name = "materialAmount", length = 20)
    private String materialAmount;          //原料数量 用量

    @Column(name = "ingredientsName", length = 20)
    private String ingredientsName;         //辅料名称

    @Column(name = "ingredientsCode", length = 50)
    private String ingredientsCode;         //辅料代码

    @Column(name = "ingredientsSite", length = 50)
    private String ingredientsSite;         //辅料地址

    @Column(name = "ingredientsSupplier", length = 20)
    private String ingredientsSupplier;       //辅料供应商

    @Column(name = "ingredientsAmount", length = 20)
    private String ingredientsAmount;          //辅料数量

    private String ingredientsBatch;         //辅料批次

    @Transient
    private String flag;    // 0=溯源入库的原料  1=非溯源入库的原料
    @Transient
    private String sourceCode;    // 溯源入库时的追溯码
}
